Part Number Hot Search : 
1N4849 TRONIC U6428 74HC25 U834BS CY7C371 B8806 N74F537N
Product Description
Full Text Search
 

To Download R01US0068EJ0100 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  user?s manual rl78 family eeprom emulation library pack02 japanese release zip file name: jp_r_ eel_rl78_p02_vx.xx_x_e rev.1.00 ma r 2014 16-bit single-chip microcontroller supported devices: rl78/d1a rl78/g1a rl78/f12 rl78/i1a rl78/f13 rl78/l13 rl78/f14 rl78/l1c rl78/g13 rl78/g14 16 all information contained in these materials, including products and pr oduct specifications, represents information on the product at the time of publication and is subject to change by renesas electronics corporation without notice. please review the latest information published by renesas electronics corporation through various means, including the renesas electronics corporation website (h ttp://www.renesas.com). www.renesas.com
notice 1. descriptions of circuits, software and other related informat ion in this document are provided only to illustrate the operat ion of semiconductor products and application examples. you are fully re sponsible for the incorporation of these circuits, software, and information in the design of your equipment. renesas el ectronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information. 2. renesas electronics has used reasonable care in preparing th e information included in this document, but renesas electronics does not warrant that such information is error free. renesas electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein. 3. renesas electronics does not assume any liability for infringeme nt of patents, copyrights, or other intellectual property ri ghts of third parties by or arising from the use of renesas electronics pr oducts or technical information described in this document. no license, express, implied or otherwise, is granted hereby under any patents, copyrights or othe r intellectual property rights o f renesas electronics or others. 4. you should not alter, modify, copy, or otherwise misappropriate any re nesas electronics product, wh ether in whole or in part . renesas electronics assumes no responsibilit y for any losses incurred by you or third parties arising from such alteration, modification, copy or otherwise misappr opriation of renesas electronics product. 5. renesas electronics products are classified according to the following two quality grades: ?standard? and ?high quality?. t he recommended applications for each renesas electronics product depends on the product?s quality grade, as i ndicated below. ?standard?: computers; office equipmen t; communications e quipment; test and measurement equipment; audio and visual equipment; home electronic a ppliances; machine tools; pe rsonal electronic equipment; and industrial robots etc. ?high quality?: transportation equipment (automobiles, trains, ship s, etc.); traffic control syst ems; anti-disaster systems; an ti- crime systems; and safety equipment etc. renesas electronics products are ne ither intended nor authorized for use in products or systems that may pose a direct threat t o human life or bodily injury (artificial life support devices or systems, surgical impl antations etc.), or may cause serious pro perty damages (nuclear reactor control systems, military equipment etc.). you must check the quality grade of each renesas electronics product before using it in a particular application. you may not use any renesas electronics product for any application for which it is not intended. renesas electronics shall not be in any way liable for any damages or losses incurre d by you or third parties arising from the use of any renesas el ectronics product for which the pr oduct is not intended by renesa s electronics. 6. you should use the renesas electronics pr oducts described in this document within the range specified by renesas electronics , especially with respect to the maximum ra ting, operating supply voltage range, movement power volta ge range, heat radiation characteristics, installation and other product characteristics. renesas electronics shall have no liability for malfunctions or damages arising out of the use of renesas electronics products beyond such specified ranges. 7. although renesas electronics endeavors to improve the quality and reliability of its produc ts, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate a nd malfunctions under certain use conditions. fu rther, renesas electronics products are not subject to radiation resistance design. please be sure to implement safety measures to guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a ren esas electronics product, such as safety desi gn for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradati on or any other appropriate meas ures. because the evaluation of microcomputer software alone is very di fficult, please evaluate the safety of th e final products or systems manufactured by you. 8. please contact a renesas electronics sales office for details as to environmental matters such as the environmental compatib ility of each renesas electronics product. please use renesas electronics products in compliance with all a pplicable laws and regulations that regulate the inclusion or use of controlled subs tances, including wit hout limitation, the eu rohs directive. renesas electronics assumes no liability for damages or losses oc curring as a result of your noncompliance with applicable laws and regulations. 9. renesas electronics products and technol ogy may not be used for or incorporat ed into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign la ws or regulations. you should not use renesas electronics products or technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. when exporting the renesas electronics products or technology describe d in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations. 10. it is the responsibility of the buyer or distributor of re nesas electronics products, who di stributes, disposes of, or othe rwise places the product with a third party, to notify such third part y in advance of the contents a nd conditions set forth in this document, renesas electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of renesa s electronics products. 11. this document may not be reproduced or duplicated in any fo rm, in whole or in part, without prior written consent of renesa s electronics. 12. please contact a renesa s electronics sales office if you have any questi ons regarding the informat ion contained in this doc ument or renesas electronics products, or if you have any other inquiries. (note 1) ?renesas electronics? as used in this document means renesas electronics corporation and also includes its majority- owned subsidiaries. (note 2) ?renesas electronics product(s)? means any product developed or manufactured by or for renesas electronics. (2012.4)
notes for cmos devices (1) voltage application waveform at input pin: waveform distortion due to input noise or a reflected wave may cause malfunction. if the input of the cmos device stays in the area between vil (max) and vih (min) due to noise, etc ., the device may malfunction. take care to prevent chattering noise from entering the device when the input level is fixed, and also in the transition period when the input level passes through the area between vil (max) and vih (min). (2) handling of unused input pins: unconnected cmos device inputs can be cause of malfunction. if an input pin is unconnected, it is po ssible that an internal input level may be generated due to noise, etc., causing malfunction. cmos devices behave different ly than bipolar or nmos dev ices. input levels of cmos devices must be fixed high or low by using pull-up or pull-down circuitry. each unused pin should be connected to vdd or gnd via a resistor if there is a possibility that it will be an output pin. all handling related to unused pins must be judged separately for each device and according to related specifications governing the device. (3) precaution against esd: a strong electric fi eld, when exposed to a mos device, can cause destruction of the gate oxide and ultimately degrade t he device operation. steps must be taken to stop generation of static elec tricity as much as possible, and quickly dissipate it when it has occurred. environmental control must be adequ ate. when it is dry, a humidifier should be used. it is recommended to avoid using insulators that easily build up static electricity. semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. all test and measurement tools including work benches and floors should be gr ounded. the operator should be grounded using a wrist strap. semiconductor devices must not be touched with bare hands. similar precautions need to be taken for pw boards with mounted semiconductor devices. (4) status before initialization: power-on does not necessarily define the in itial status of a mos device. immediately after the power source is turned on, devices with reset functions have not yet been initialized. hence, power-on does no t guarantee output pin levels, i/o settings or contents of registers. a device is not initialized until the re set signal is received. a reset operation must be ex ecuted immediately after power-on for devices with reset functions. (5) power on/off sequence: in the case of a device that uses different power supplies for the internal operation and external interface, as a rule, switch on the external power supply after switching on the internal power supply. when switching the power supply off, as a rule, switch off the exte rnal power su pply and then the internal power supply. use of the reverse powe r on/off sequences may result in the application of an overvoltage to the internal elements of the device, causing malfunction and degradation of internal elements due to the passage of an abnormal current. the corre ct power on/off sequence must be judged separately for each device and according to related sp ecifications governing the device. (6) input of signal during power off state : do not input signals or an i/o pull-up power supply while the device is not powered. t he current injection that results from input of such a signal or i/o pull-up power supply may cause malfunction and the abnormal cu rrent that passes in the device at this time may cause degradation of internal elemen ts. input of signals during the power off state must be judged separately for each device and according to re lated specifications governing the device.
how to use this manual target readers this manual is intended for users who wish to understand the f eature s of the rl78 microcontrollers eeprom emulation library pack 02 and to use the library in design ing and develop ing application systems. the target p roducts are as follows. rl78/d1a, rl78/f12, rl78/f1 3, rl78/f1 4, rl78/g13, rl78/g14, rl78/g1a, rl78/i1a, rl78/l13 , rl78/l1c purpose this manual is intended to give users understanding of how to use eeprom emulation l ibrary pack 02 to rewrite the flash da ta memor y in rl78 -f amily microcontrollers (i.e. write constant data by the application) . organization the rl78 eeprom emulation library pack 02 user?s manual is separated into the following parts : ? overview of eeprom emulation ? using eeporm emulation ? eepr om emulation function how to read this manual it is assumed that the readers of this manual have general knowledge of electrical engineering, logic circuits, and microcontrollers. ? to gain a general understanding of f eature s -> read this manual in order of the table of contents . ? for details on the functions of the library - > refer to section 5, user interface , of this user ? s manual . conventions data significance : higher - order digits to the left and lower - order digits to the right active low representatio ns : xxx (overscore over pin and signal name) note : footnote for item marked with note in the text. caution : information requiring particular attention remark : supplementary information numeral representation: binary ... xxxx or xxxxb decimal ... xxxx hexadecimal ... xxxxh or 0xxxxx all trademarks and registered trademarks are the property of their respective owners. eeprom is a registered trademark of renesas electronics corporation.
rl78 family eeprom emulation library pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 5 of 5 3 mar . 28, 2014 contents chapter 1 overview ..................................................................................................... 7 1.1 outline ....................................................................................................................................... 7 1.2 target devices .......................................................................................................................... 7 1.3 definition of terms .................................................................................................................. 7 chapter 2 eeprom emulation ................................................................................... 9 2. 1 specifications o f eeprom emulation ...................................................................................... 9 2. 2 outline of function ..................................................................................................................... 9 2. 3 eel architecture ....................................................................................................................... 11 2. 3. 1 system structure ........................................................................................................ 11 2. 3. 2 eel pool ...................................................................................................................... 11 2. 3. 3 structure of eel block ............................................................................................... 13 2. 3. 4 eel block header ....................................................................................................... 14 2. 3. 5 structure of stored data ............................................................................................ 15 2. 3. 6 eel block overview ................................................................................................... 16 chapter 3 eel functional specifications ................................................................ 17 3.1 eel functions / commands of the eel_execute function .............................................. 17 3. 1. 1 eel_cmd_startup command [ startup processing ] ........................................... 17 3. 1. 2 eel_cmd_shutdown command [shutdown processing] .................................. 17 3. 1. 3 eel_cmd_refresh command [refresh processing] .......................................... 17 3. 1. 4 eel_cmd_format command [format processing] ............................................. 18 3. 1. 5 eel_cmd_write command [write processing ] .................................................... 18 3. 1. 6 eel_cmd_read command [read processing] ...................................................... 18 3. 1. 7 eel_cmd_verify com mand [verify processing] .................................................. 18 3.2 state transitions .................................................................................................................... 19 3.3 basic flowchart ...................................................................................................................... 21 3.4 command operation flowchart ........................................................................................... 23 3.5 bgo back ground operation function ........................................................................... 24 chapter 4 using eeprom emulation ....................................................................... 25 4.1 caution points ........................................................................................................................ 25 4.2 number of stored user data items and total user data size ............................................... 27 4.3 initial values to be set by user ............................................................................................. 28 chapter 5 user interface ........................................................................................... 31 5. 1 request structure (eel_request_t) settings ........................................................................... 31 5.1.1 user write access ...................................................................................................... 32 5.1.2 user read access ...................................................................................................... 32 5. 2 eel function calls ................................................................................................................... 33 5. 3 data types ................................................................................................................................. 33 5. 4 eel function ............................................................................................................................. 34 fdl_init ................................................................................................................................... 35 fdl_open ............................................................................................................................... 36 fdl_close ............................................................................................................................... 37 eel_init ................................................................................................................................... 38
rl78 family eeprom em ulation library pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 6 of 5 3 mar . 28, 2014 eel_open ............................................................................................................................... 39 eel_close ............................................................................................................................... 40 eel_execute .......................................................................................................................... 41 eel_handler ........................................................................................................................... 45 eel_getspac e ........................................................................................................................ 46 eel_getversionstring ........................................................................................................... 47 chapter 6 software resources and processing time ............................................ 48 6. 1 processing time ....................................................................................................................... 48 6. 2 software resources ................................................................................................................. 50 6. 2. 1 sections ....................................................................................................................... 52 appendix a revision history .................................................................................. 53 major changes in this document .................................................................................................. 53
rl78 family chapter 1 overview eeprom emulation library pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 7 of 5 3 mar . 28, 2014 chapter 1 overview 1.1 o utline eeprom emulation is a feature used to st ore data in the on- board flash memory in the same way as eeprom. during eeprom emulation, the d ata f lash library and eeprom emulation library are used, and the data flash memory is written to and read from. the d ata f lash library is a software library used to perform operations on the data flash memory. the eeprom emulation library is a software library used to execute eeprom emulation from a user - created program. the d ata f lash library and eeprom emulation library are placed in the code flash memory for use. the eeprom emulation library is free software to rewrite the d ata f lash through the user program . in this user?s manual, processing of the eeprom emulation library includes processing of the d ata f lash library. be sure to use this user?s manual together with the release note supplied with the package of this eeprom emulation library and the user?s manual for the target device. 1.2 target devices for the latest device info rmation, please contact our distributors or sales representatives. 1.3 definition of terms the terms used in this manual are defined below. ? pack "pack" is an identification name representing an eeprom emulation library type. use the pack corresponding to your device . ? eel an abbreviation of the eeprom emulation library . in this user?s manual, the rl78 eeprom emulation library pack02 is hereafter referred to as eel . ? fdl an abbreviation of th e d ata f lash library. ? f sl an abbreviation of the flash self programming library. ? eel function a generic term for the functions offered by the eel .
rl78 family chapter 1 overview eeprom emulation library pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 8 of 5 3 mar . 28, 2014 ? fdl function a generic term for the functions offered by the fd l. ? fs l function a generic term for the functions offered by the fs l . ? block number a number which identifies a block of flash memory. ? eel block s an a bbreviation of blocks that the eeprom emulation library accesses. i n this user?s manual, eeprom emulation blocks are hereafter referred to as eel blocks. ? cf code flash ? df data flash
rl78 family chapter 2 eeprom emulation typ e 0 1 eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 9 of 5 3 mar . 28, 2014 chapter 2 eeprom emulation 2. 1 specifications of eeprom emulation by calling the eel function provided by the eel f rom a user - created program, use is possible without the awareness of data flash memory operations. for the eel, a one- bye identifier (data id : 1 to 64) is assigned by the user for each data item, and reading and writin g using any unit from 1 to 255 bytes are possible on an assigned identifier basis. ( the eel can handle up to 64 identifiers. ) note that three or more continuous block area of data flash memory (recommended) note are used to store the data. these blocks are called eel blocks. data written by eeprom emulation is divided into reference data and user - specified data, and the reference data is written to the target blocks from the lower block address, while the user data is written from the higher block address . note : at least two blocks are necessary for eeprom emulation. when two blocks are specified, if a write error occurs even once, only reading of normally written data is possible but writing is no longer possible. after that, the two target blocks must be forma tted when the eel is used to write data. written data is erased completely. since a contingency (such as voltage drop) may occur in the system, we recommend that you specify at leas t three blocks. 2. 2 outline of fun ction the eel provides basic read/write functions having the following features. ? up to 64 data items settabl e ? a data size of 1 to 255 bytes settable ? supporting the b ack g round o peration ( bgo) ? consumption of memory for management data (10 bytes per eel block and 2 bytes per eel block write data) ? reset resistance (eel_cmd_write , eel_cmd_refresh) ? block rotation (averaging d ata f lash use frequency ) renesas electronics also provides rl78 eeprom emulation library pack 01 (eel pack01) as another eel. eel consumes smaller amount of resource than eel pack01. other functional differences are listed in the table bel ow. (for details of functions, see the rl78 microcontroller eeprom emulation library pack 01 user?s manual r01us0054ej0102.)
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 10 of 5 3 mar . 28, 2014 item eel pack01 eel user data length 1 to 255 1 to 255 amount of stored user data note 1 1 t o 255 1 to 64 data id range 1 to 255 1 to 64 number of eeprom emulation blocks note 2 4 to 255 3 to 255 recommended user data size note 1 980 x total number of blocks x 1/4 - 980/ 2 bytes 1014/2 bytes enforce mode and timeout mode supported not supported back ground maintenance processing supported not supported data id number can be set arbitrarily cannot be set arbitrarily auto - checksum for data supported not supported note1 : the total siz e of user data must be within 1/2 of each block when all user data are written to an eel block . therefore, the range used for the number of stored user data items differs depending on the size of the stored user da ta. it is also necessary to consider the size of the reference data provided for each data item for management use when determining the total size. for details about the number of stored user data items and total size, see 4.2 number of stored user data items and total user data size. note 2 : eel blocks cannot be set more than maximum number of blocks of on- board data flash memory.
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 11 of 5 3 mar . 28, 2014 2. 3 eel architecture this chapter describes the eel architecture required for the user to rewrite d ata f lash ( the eel pool) by using the eel . 2. 3. 1 system structure the eel offers interface for accessing t he data flash area defined by the user. the arrows shown in the figure 2 - 1 below indicate the flow of processing . figure 2 -1 system structure 2. 3. 2 eel pool t he eel pool is a user - defined d ata f lash area that is accessible by the eel. the user program can access the d ata f lash only by using this eel pool in the d ata f lash via the eel . the eel pool size must be spe cified with the number of blocks in the d ata f lash of the target device. for the procedure to specify the number of blocks, see section 4.3 , initial values to b e s et by user . the eel pool is divided into 1024 - byt e blocks . each block has a state which indicates the current usage of the block. state description active only a single eel block is active at a time to store defined data. the active block circulates in d ata f lash blocks allocated in the eel pool. invalid no data is stored in invalid blocks. eel blocks are marked as invalid by the eel or become invalid in the case of erasure blocks. excluded if functional operation failed and possibility of a d ata f la sh failure is clarified, the eel excludes the relevant block and the block is no longer used for eeprom emulation. before using the eel, the fdl must be initialized. ( fdl_init and fdl_open function ) `??? code flash user program eel fdl data flash (eel pool )
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 12 of 5 3 mar . 28, 2014 figure 2 -2 shows an exemplary pool configuration for a device with 8 kb d ata f lash . when no writable area is remaining in the active block (block 1 in the example) and data can no longer be stored (failure in write command ), a new active block is selected in a cyclic manner and the current valid data set is copied to this new active block. this process is referred to as refresh. after the eel_cmd_refresh command is executed, the previous active block becomes invalid and only a single active block exists. excluded blocks (like block 7 in the example) are ignored during this process and not considered as candidates for the selection of the next active block. figure 2 -2 eel pool structure the overall life cycle of a block in the eel p ool is shown in figure 2 - 3 . during normal operation, the block switches between active and invalid stat e . when an error occurs during an access to the eel block, the error eel block is marked as excluded. this block will not enter the lifecycle again. however, the user can try to reanimate the block by a format of the complete pool which also erases al l existing data content . figure 2 -3 life cycle of an eel block invalid block active block excluded block a i x format physical block 0 physical block 1 physical block 2 physical block 3 physical block 4 physical block 5 physical block 6 physical block 7 eel block 0 data flash memory eel pool eel block 1 eel block 2 eel block 3 eel block 4 a i x active block invalid block excluded block a i i i i eel block 5 eel block 6 eel block 7 i i x
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 13 of 5 3 mar . 28, 2014 the eel pool has the four states shown below. table 2 -1 states of the eel pool s tate description pool operational this is the usual case during eel operation. all commands are available and can be executed . pool full free space for data wr ite is insufficient in the active block in use. this stat e indicates that a refresh needs to be executed. pool exhausted no continuously usable eel block is left. (at least two blocks that are not exclude d are n ecessary for eel operations.) pool inconsistent there is a mismatch in the pool state and the data structure in the eel block does not match the user - set data structure. the eel block is in the undefined state (e.g. no ac tive block is present). 2. 3. 3 structure of eel block the detailed block structure used by the eel is depicted in figure 2 - 4 . in general, an eel block is divided into three utilized areas : the block header, the reference area and the data area. figure 2 -4 ell block structure (example of rl78/g13 data flash block 0) table 2 -2 co n figuration of each eel block name description block header the block header contains all block status information needed for the block management within the eel - pool . it has a fixed size of 8 byte s. reference area the reference area contains reference data which are required for the management of data . when data is written, this area extends in the address increment direction. data area the data area contains user data . when data is written, this area extends in the addre ss decrement direction. block header reference area separator (erased 2 bytes) erased area (all bytes 0xff) data area 0xf1000 0xf13ff growing growing
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 14 of 5 3 mar . 28, 2014 be tween reference area and data area, there is an erased area . with each eel data update (i.e. the data is written), this area is reduced successively. however, at least two bytes o f space always remain between reference area and data area for management and separation of these areas. this is indicated by the separator in figure 2 -4 . the eel block header is detailed in 2.3.4 , eel block h eader , while the structure of data stored in the reference and data ar ea are described in section 2. 3. 5 , st ructure of stored data . 2. 3. 4 eel block header the structu re of the block header is depicted in figure 2 -5 . it is composed of eight bytes, four of which are reserved for the system. figure 2 -5 structure of eel block header the block status flags start at the beginning of the block and include the a flag, b flag, i flag, and x flag, each of which is one byte, for a total of 4 bytes of data. t he combination of flags indicates the eel block status. figure 2 -5 shows the plac ement status of flags, and table 2 - 3 shows the combination status of flags. table 2 -3 overview s of block status flags block status flag state description a flag b fla g i flag x fla g 0x01 0xfe 0xff 0xff active currently used block after the eel_cmd_refresh command is execu ted, the a flag of a new active block is set to 0x02. 0x02 0xfd 0xff 0xff currently used block after the eel_cmd_refresh command is executed, the a flag of a new active block is set to 0x0 3 . 0x03 0xfc 0xff 0xff currently used block after the eel_cmd_refresh command is executed, the a flag of a new active block is set to 0x0 1 . data other than the above 0xff 0xff invalid invalid block -- o ther than 0x ff 0xff -- -- o ther than 0x ff excluded excluded block n reserved 0 x 00 0 x 00 reserved 0 xff - n a - x i b - reserved - reserved - 0 x 0000 0 x 0001 0 x 0002 0 x 0003 0 x 0004 0 x 0005 0 x 0006 0 x 0007 relative byte index within block
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 15 of 5 3 mar . 28, 2014 2. 3. 5 structure of stored data the structure of stored data when user data is written to an eel block is shown in the figure below. a data is composed of three parts : the start -of - record (sor) field and the end -of - record (eor) field and the data field. the eel descriptor table can be used to set data for use in the eel. each data is referred to by an identification number (id) and can have a size between 1 and 255 byte. (the exact specification of the format of the eel descriptor can be found in section 4.3) each time data is written, stored data increase in the eel block and multiple units of stored data exist in the eel block, but only the most recent stored data is referenced . sor and eor build up the so - called r eference data which is required for the management of the data. the reference data and user data values are stored in different sections of the active block, namely the reference area and the data area, respectively. figu re 2 -6 shows the overview of the entire structure of stored data. figure 2 -6 structure of stored data table 2 -4 description of each fi el d of data area name description sor field ( s tart of record ) the one- byte sor field contains the id of data. this field indicates the start of write processing. data ids 0x00 and 0xff are not used to avoid patterns of erased cells. eor field ( end of record ) the one- byte eor field contains a 0xff ? data id value. this field indicates successful end of write processing. if writing does not end normally due to a device reset or other reasons, the corresponding stored data is ignored by the eel. dat a field the data field contains the user data . the size of user data is 1 to 255 bytes. when data of two bytes or more is stored, the smallest address of the data is allocated to the smallest address of the data fi eld (as shown in figure 2 - 7 ) data is written to the eel block in the order of sor - > data field -> eor. if write processing does not end successfully, the immediately previous data becomes valid. note1 : the total si ze of the reference consumed by each stored data is 2 bytes. this should be considered when evaluating the free space in a block before writing the data through the eel_getspace functio n. note2 : no checksum is added to user data. if a checksum is needed, add it to user data and check through the user program. id data 0xff -id reference data in eel block reference area sor eor 0x0000 data size - 1 data field in eel block data area
rl78 family chapter 2 eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 16 of 5 3 mar . 28, 2014 2. 3. 6 eel block overview figure 2 -7 shows an example of an eel block that contains multiple units of stored data : ? da ta id 0x01 with size = 0x04, ? data id 0x02 with size = 0x01 ? data id 0x03 is defined but not written here, ? data id 0x04 with size = 0x02 the data have been written in the sequence id 0x01 -> id 0x04 -> id 0x02. in this example, the data with id 0x03 has not been written yet. figure 2 -7 example of an active eel block sor id = 0x04 sor id = 0x01 sor id = 0x 02 a = 0x02 erased area (all bytes 0xff) data(id=0x01)[0] data(id=0x04)[1] data(id=0x02)[0] reference area data area separator (erased 2 bytes) b = 0xfd i = 0xff x = 0xff reserved reserved reserved reserved 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007 eor ~id = 0xfe eor ~id = 0xfb eor ~id = 0xfd 0x0008 0x0009 0x000a 0x000b 0x000c 0x000d 0x000e 0x000f data(id=0x01)[1] data(id=0x01)[2] data(id=0x01)[3] 0x03ff data(id=0x04)[0] 0x03fe 0x03fd 0x03fc 0x03fb 0x03fa 0x03f9 0x03f8 ? ? ? ? ? ? ? ? ? block header relative byte index within block
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 17 of 5 3 mar . 28, 2014 chapter 3 eel functional specifications th is chapter describes the functional specifications of the eel required for the user to execute eeprom emulation. 3.1 eel functions / commands of the eel_execute function the table below summarizes the eel functions offered by th e eel. table 3 -1 eel functions ee l function name functional overview fdl_init initializes the fdl. fdl_open p reparation processing of fdl fdl_close e nd processing of fdl eel_init initializes the eel eel_open p reparation processing of eel eel_close e nd processing of eel eel_execute manip ulates d ata f lash with commands. command : e el_cmd_startup eel_cmd_write eel _cmd_read eel_cmd_refresh eel_cmd_verify eel_cmd_format eel_cmd_shutdown eel _handler controls the eel while it is running. eel_getspace checks free space in the eel block eel_getversionstring obtains eel version information. with the eel_execute function, the following commands can be executed. 3. 1. 1 eel_cmd_startup command [ startup processing ] this checks the block status and sets the system to the eeprom emulation start (started ) stat e . 3. 1. 2 eel_cmd_shutdown command [shutdown processing] set the eeprom emulation operation to t he stopped state (opened ). 3. 1. 3 eel_cmd_refresh command [refresh processing] the latest stored data is copied from the active block (copy source block ) to the next block (copy destination block ) in the eel pool after the erase p rocessing. this makes the copy destination block active.
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 18 of 5 3 mar . 28, 2014 3. 1. 4 eel_cmd_format command [format processing] this initializes (erases ) everything, including the data recorded in the eel blocks. be sure to use this command before usi ng eeprom emulation for the first time. 3. 1. 5 eel_cmd_write command [write processing ] write the specified data to an eel block. 3. 1. 6 eel_cmd_read command [read processing] read the specified data from an eel block . 3. 1. 7 eel_cmd_verify command [verify processing] this command performs internal verification to check signal levels of the active block.
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 19 of 5 3 mar . 28, 2014 3.2 state transitions to use eeprom emulation from a user - created program, it is necessary to initialize the eel and exe cute functions that perform operations such as reading and writing on eel blocks. figure 3 -1 shows the overall state transitions, and figure 3 - 2 shows an operation flow for using basic features. when using eeprom emulation , incorporate eeprom emulation into user - created programs by following this flow . figure 3 -1 state transition s diagram fdl_i nit() fdl_open() eel_init() closed fdl_close() eel_open() eel _ close () opened format executing busy startup e xecuting busy eel_cmd_format eel_cmd_startup status :ok status :error start ed status :ok error verify eel _ cmd _ format eeprom command e xecuting busy eel _ cmd _ write eel _ cmd _ read eel _ cmd _ refresh eel _ cmd _ verify status :ok status :error eel _ cmd _ shutdown status : error eel _ cmd _ startup reset or power on uninitialized exhausted eeprom command e xecuting busy eel _ cmd _ read eel _ cmd _ verify status : ok status : error status : error pool_exhausted status : error pool _ exhausted eel _ cmd _ shutdown note 1 : eel_close and eel_init can be called from every state. please note however, that this interrupts any eel processing and can lead to unpredictable behavior. note 2 : once the eel_cmd_format command is started, be sure to finish it.
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 20 of 5 3 mar . 28, 2014 [overview of state transitions diagram ] to use eel to manipulate the data flash memory, it is necessary to execute the provided functions in order to advance the processing . (1 ) uninitialized this is th e state after turning the power on or resetting. (2 ) closed this is the state in which the data to perform eeprom emulation is initialized by executing the fdl_init, fdl_open, and eel_init function s (no ongoing operation to the d ata f lash memory). to execute fsl , stop mode, or halt mode proces sing after executing eeprom emulation, execute e el_close in the opened state to switch to the closed state . (3 ) opened this state is switched to by executi ng eel_open in the closed state and makes it possible to perform operations on the data flash memory. it is not possible to execute fsl , stop mode, or halt mode processing until eel_close is executed and the system switches to the closed state . (4 ) started this state is switched to b y executing the ee l_cmd_startup command in the opened state and makes it possible to execute eeprom emulation. writes and reads that use eeprom emulation are performed in this state . (5 ) exhausted this state is made from the opened or started state when continuously usable eel blocks have been exhausted during command execution. in this state, only eel_cm d_read, eel_cmd_verify, and eel_cmd_shutdown c ommands are executable. (6 ) busy this is the state used when executing a specified command. the state that is switched to differ depending on which command is executed and how it ter minates.
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 21 of 5 3 mar . 28, 2014 3.3 basic flowchart figure 3 -2 below shows the basic procedure to perform read and write operations for the d ata f lash by using the eel. figure 3 -2 basic flowchart of eel note 1 : when using the eeprom emulation for the first time, be sure to execute the eel_cmd_format c ommand. note 2 : error processing is omitted in the above flowchart. start end (2) fdl_open function (11 ) f dl_close function (3) eel_init function (10) eel_c lose function (4) ee l_open function (5) eel_execute function eel_c md_startup (6) eel_execute function eel_cmd _write (7 ) eel_execute function eel_cmd_read (9) e el_ execute function eel_ cmd_shutdown (1) fdl_init function eel_err_pool_full? (8) eel_execute function eel_cmd _refresh yes no
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 22 of 5 3 mar . 28, 2014 [overview of basic operation flow] (1) fdl initialization processing (f d l_init) because it is necessary to initialize the fdl parameters (ram) if using the eel t o access the data flash memory, the fdl_init function must be executed in advance. if fsl processing was executed after this initialization finished, the initialization processing must be re - executed . (2) fdl preparation processing (fdl_open) set the data flash control reg ister (dflctl) to the state where accessing the data flash memory is permitted (dflen = 1). (3) eel initialization processing (eel_init) initialize the parameters (ram) used by the eel. (4) eeprom emu lation preparation processing (eel_open) set the data flash memory to a state (opened) for which control is enabled to execute eeprom emulation . (5) eeprom emulation execution start processing (eel_execute : eel_cmd_startup com mand) set the system to a state (started) in which eeprom emulation can be executed . (6) eeprom emulation data write processing (eel_execute : eel_cmd_write command) write the specified data to an eel block. (7) eeprom emula tion data read processing (eel_execute : eel_cmd_read command) read the specified data from an eel block . (8) eeprom emulation refresh processing (eel_execute : eel_cmd_ refresh command) the latest stored data is copied from the active block (copy source block) to the next block (copy destination block) in the eel pool after the erase processing. this makes the copy destination block active (9) eeprom emulation execution stop processing (eel_execu te : eel_cmd_shutdown command) set the eeprom emulation operation to the stopped state (opened). (10) eeprom emulation end processing (eel_close) set the data flash memory to a state (closed) for which control is disabled to stop eeprom emulation. (11) fdl end processing (fdl_close) set the data flash control register (dflctl) to the state where accessing the data flash memory is inhibited (dflen = 0).
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 23 of 5 3 mar . 28, 2014 3.4 command operation flowchart the figure below shows the basic procedure to perform read and write operations for d ata f lash by using the eel. figure 3 -3 command operation flowchart (1) eel_execute function perform operations for d ata flash. (2) busy state check check status_enu of the request structure (eel_request_t). when status_enu is eel_busy, continue the d ata f lash operation. if status_enu is other than eel_busy, terminate the d ata f lash operation with an error. (3) eel_handler function control the eel while it is running. by repeating the execution of the eel_handler function, continue the d ata f lash operation. (4) final state check if the final state is eel_ok, the operation ends normally. otherwise, it will be terminated with an error. (1)eel_execute function start error (2) busy state check (3) eel _handler function (4) final state check normal end not busy busy normal end abnormal end
rl78 family chapter 3 eel functional specifications eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 24 of 5 3 mar . 28, 2014 3.5 bgo back ground operation function the eel_execute function starts command processing and then immediately returns the control to the user program. this allows the user program to run during the d ata f lash operation and so is called back ground operation (bgo). the d ata f lash read or write command processing is started by executing the eel_execute function, and the processing is continued and completed by executing the eel_handler function. for this reason, the eel_handler function must be executed continuously until the processing is completed. to see if the processing requested from the eel_execute function has been successfully completed, call the eel_handler function from the user program and check the stat us of ongoing processing. the eel_cmd_shutdown command does not require calling of the eel_handler function. however, we recommend that you follow the command operation flo wchart shown in figure 3 - 3.
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 25 of 5 3 mar . 28, 2014 chapter 4 u sing eeprom emulation eeprom emulation can store a maximum of 64 note data i tems each consisting of 1 to 255 bytes in the flash memory by using three or more block s (recommended) of flash memory . eeprom emulation can be executed by incorporating the eel into a user - created program and executing that program . note : for details about the number of user data items that can be stored, see 4.2 number of stored user data items and total user data size. 4.1 caution points eeprom emulation is achieved by using a feature for manipulating the on- board microcontroller data flash memory. therefore, it is necessary to note the following table 4 -1 points for caution ( 1/2) no caution points 1 all eel codes and constants must be placed in the same 64-k byte flash block. 2 initialization by the fdl_init function must be performed before the fdl_open, fdl_close, or any eel function is executed. 3 the eel must be initialized by the eel_init function before any eel function is executed. 4 t he data flash memory cannot be read during data flash memory operation by the eel . 5 do not execute stop mode or halt mode processing while the eeprom emulation is being used. if it is necessary to exe cute stop mode or halt mode processing, be sure to execute all of the processing up to and including the eel_close function and fdl_close function to finish eeprom emulation. 6 the watchdog timer does not stop during the execution of the eel. 7 the request structure (eel_request_t) must be placed at an even address. 8 do not destroy the request structure (eel_request_t) during command execution. 9 initialize the argument (ram) that is used by the eeprom emulation library function. when not initialized, a ram parity error is detected and the rl78 microcontroller might be reset. for a ram parity error, refer to the user?s manual of the target rl78 microcontr oller. 10 all members of the request structure (eel_request_t) must be initialized once before a command is executed. if any unused member exists in the request structure (eel_request_t), set a desired value for the member. if any member is not initialized, the rl78 microcontroller may be reset due to a ram parity error. for details, see the user?s manual : hardware for the rl78 microcontroller in use. 11 the eel does not support multitas k execution. do not execute the eel functions during interrupt processing.
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 26 of 5 3 mar . 28, 2014 table 4 -2 points for caution (1/2) no caution points 12 after the fdl_close and eel_close functions have been executed, the requested command and ongoing command s top and cannot be resumed. before calling the fdl_close and eel_close functions, finish all ongoing commands. 13 before using the eeprom emulation library, always close the fsl . also, do not run the fsl while the eepro m emulation library is being used. when using the fsl , be sure to execute all of the processing up to and including the eel_close function and fdl_close function to finish eeprom emulation. when using eeprom emulation aft er executing fsl processing, it is necessary to start processing from the initializing function (the f d l_init function). 14 before starting the eeprom emulation, be sure to start up the high - speed on- chip oscillator first. th e high - speed on - chip oscillator must also be activated when using the external clock. 15 in address above 0xffe20 (0xfe20), do not place data buffer (argument) or stack which is used by eel functions and fdl functions. 16 when using data transfer controller (dtc) during eeprom emulation, do not place ram area used by dtc in self - ram and in address above 0xffe20 (0xfe20). 17 until eeprom emulation is finished, do not corrupt ram area (inclu ding self - ram) used by eeprom emulation. 18 no checksum is added to user data. if a checksum is needed, add it to user data and check through the user program. 19 when the fdl descriptor or eel descriptor is changed, the eeprom emulation can no longer be executed. in that case, the eel pool must be formatted by the eel_cmd_format command in addition to initialization of fdl and eel. when adding data, however, the eeprom emulation can be continuously executed. 20 do not operate the data flash control register (dflctl) during the execution of th e eel. 21 to use the data flash memory for eeprom emulation, it is necessary to execute the eel_cmd_forma t command upon first starting up to initialize the data flash memory and make it usable as eeprom emulation blocks. 22 it is recommended that at least three blocks be provided in the d ata f lash memory to use the eel. 23 do not destroy eel blocks by the user program that uses other eels or fdls. 24 the eel does not support multitask execution. when executing an eel function on the os, do not execute in from two or more tasks. 25 about an operation frequency of rl78 microcontrollers and an operation frequency value set by the initializing function (f d l_init), be aware of the following points : - when using a frequency lower than 4 mhz as an operation frequency of rl78 microcontrollers, only 1 mhz, 2 mhz and 3 mhz can be used (frequencies other than integer values like a 1.5 mhz cannot be used). also, set an integer value 1, 2, or 3 to the operation fr equency value set by the initializingfunction. - when using a frequency of 4 mhz or higher note1 as an operation frequency of rl78 micr ocontrollers, a certain frequency can be used as an operation frequency of rl78 microcontrollers. - this operation frequency is not the frequency of the high - speed on - chip oscillator. note 1 : for a maximum frequency, see the target rl78 microcontroller user?s manual.
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 27 of 5 3 mar . 28, 2014 4.2 number of stored user data items and total user data size the total size of user data that can be used in the eeprom emulation is limited. the size required for writing a ll user data to an eel block must be within 1/2 of the block. therefore, the number of stored data items that can be used differs depending on the size of user data that is actually stored. the following shows how t o calculate the size that can be used when actually writing user data, as well as the total user data size . [ maximum usable size of one block that can be used to write the user data ] size of one block of data flash memory : 1024 byte s size required for eeprom emulation block management : 8 bytes free space necessary as termina tion information (separator) : 2 bytes maximum usable size of one block = 1024 byte s - 8 byte s - 2 byte s = 1014 byte s [ maximum size and recommended size ] data must be held in one block. therefore, the maximum size is the m aximum usable size of one block but the following relational expression should be met. to enable all data to be updated at least once, we recommend that the data be w ithin the half size of the maximum usable size of one block. maximum size = the basic total user data size + maximum data size + 2 1014 ( assumed that the largest data can be updated once after all data have been written.) recommended size = 1014 / 2 (assumed that all data can be updated once after all data have been written.) [ calculating the size for writing each user data item ] note size of each written user data item = data size + reference data size ( 2 bytes) note : for details, see 2 . 3 . 5 structure of stored data . [ calculating the basic total user data size ] basic total size = (user data 1 + 2 ) + (user data 2 + 2 ) ... + (user data n + 2 )
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 28 of 5 3 mar . 28, 2014 4.3 initial values to be set by user as the initial values for the eel , be sure to set the items indicated below. in addition, before executing the eel , be sure to execute the high - speed on - chip oscillator. the high - speed on - chip oscillator must also be activated when usin g the external clock. ? number of stored data items, and specific data ids and data size < data flash library user include file ( fdl _descriptor.h)> note 1 , 2 note 1, 2 note 2 note 1 : the macros and macro names that are being used have common parameters w ith the eel , so changes should be made to numerical values only. note 2 : after initializing the eeprom emulation blocks (after executing the eel_cmd_format command), do not change the values. if the values are changed, reinitialize the eel blocks (by executing the eel_cmd_format command ). #def ine eel_var_no 8 #define fdl_system_frequency 32 000000 #define fdl_wide_voltage_mode #define fdl_pool_blocks 0 #define eel_p ool_blocks 4 : (1) operation frequency : (2) voltage mode : (3 ) f dl pool size : (4) eel pool size : (5) number of stored data items __far const eel_u08 eel_descriptor[eel_var_no+2] = { (eel_u08)(eel_var_no), /* variable count */ (eel_u08)(sizeof(type_a)), /* id=1 */ (eel_u08)(sizeof(type_b)), /* id=2 */ (eel_u08)(sizeof(type_c)), /* id=3 */ (eel_u08)(sizeof(type_d)), /* id=4 */ (eel_u08)(sizeof(type_e)), /* id=5 */ (eel_u08)(sizeof(type_f)), /* id=6 */ (eel_u08)(sizeof(type_x)), /* id=7 */ (eel_u08)(sizeof(type_z)), /* id=8 */ (eel_u08)(0x00), /* zero terminator */ }; : (6) data size of the identifier (data id)
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 29 of 5 3 mar . 28, 2014 (1) operation frequency this sets an operation frequency which is used in rl78 microcontrollers. note 1 the setting value is set to the f d l_init frequency parameter by the following expressions (the frequency is calculated by raising its decimals. the result calculated omits its decimals.). setting value of f d l_init operation frequency = ((fdl_system_frequency + 999999)/1000000) ex.1 : when fdl_system_frequency is 20000000 (20 mhz), ((20000000 + 999999)/10000000) = 20.999999 = 20 ex.2 : when fdl_system_frequency is 4500000 (4.5 mhz), ((4500000 + 999999)/10000000) = 5.499999 = 5 ex.3 : when fdl_system_frequency is 5000001 (5.000001 mhz), ((5000001 + 999999)/10000000) = 6.000000 = 6 note 1 : this setting is a value required to control data flash memory. this setting does not change the operation frequency o f rl78 microcontrollers. in addition, this operation freque ncy is not the frequency of the high - speed on - chip oscillator. (2) voltage mode note 2 this sets the voltage mode of data flash memory. note 3 when fdl_wide_voltage_ mode is not defined : full - speed mode when fdl_wide_voltage_mode is defined : wide voltage mode note 2 : the fdl_wide_voltage_mode is commented out and not defined in the initial setting. to use rl78 microcontrollers in the wide voltage mode, cancel the comment - out to define the mode. note 3 : for details of the voltage mode, see the corresponding rl78 microcontroller s user?s manual. (3) f d l pool size specify 0. (4) eel pool size note 4 the number of blocks in the d ata f lash memory of the targ et device must be specified as the number of blocks in the eel pool. note 4 : specify 3 (3 blocks) or a greater value (recommended). (5 ) number of stored data items specify the number of data items to be used in the eeprom emulation. a value of 1 to 64 c an be set.
rl78 family chapter 4 using eeprom emulation eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 30 of 5 3 mar . 28, 2014 (6) data size of each data identifier (data id) a table to define the data size of each identifier is provided below. this is called an eel descriptor table. the eel can only add identifiers while the program is running. data to be written must be registered in the eel descriptor table in advance. figure 4 -1 eel descriptor table (when t here a re eight d ifferent d ata ) __far const eel_u08 eel_descriptor [ number of stored data items + 2 ] eel_var_no byte size of data id1 byte size of data id 2 byte size of data id 3 byte size of data id 4 byte size of data id 5 byte size of data id 6 byte size of data id 7 byte size of data id 8 0x00 ? eel_var_no user - specified number of data items used in the eel ? byte size of data idx user - specified size of user data (in bytes) ? termination area (0x00) specify 0 as the termination information.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 31 of 5 3 mar . 28, 2014 chapter 5 user interface 5. 1 request structure ( eel _request_t) settings b asic operations such as reading from and writing to the d ata f lash are performed by a single function. the function transfers commands and data id to the eel via the request structure (eel_request_t). furthermore, the eel state and erro r information are acquired via the request structure (eel_request_t). in subsequent sections, write access to the request structure (eel _request_t) from the user is called user write access, and read access to it from the u ser is called user read access. figure 5 -1 request structure ( eel_request_t ) the request structure ( eel _ re quest_t) is defined in the eel _types.h file. it shou ld not be changed by the user. [definition of the request structure ( eel _request_t)] typedef struct { __near eel_u08* address_pu08 ; eel_u08 identifier_u08 ; eel_command_t command_enu ; eel_status_t status_enu ; } eel_request_t ; eel user program address_pu08 identifier_u08 command_enu status_enu user read access user write access
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 32 of 5 3 mar . 28, 2014 figure 5 -2 alignment of variables of the request structure (eel _request_ t) 5.1.1 user write access (1) address_pu08 specify the start address of the data buffer used for eel_cmd_write command and eel_cmd_read command execution. associated command (macro name) setting eel_cmd_writ e start address of the data buffer note 1 eel_cmd_read start address of the data buffer note 2 note 1 : buffer which contains data written by the user note 2 : buffer which contains data read from the d ata f lash (2) identifier _u08 specify the data id used for each command. for more information about how to do this, see the description of the eel_execute function in section 5.4, eel functions . associated command (macro name) setting eel_cmd_write id of write data eel_cmd_read id of read data (3) command_enu commands to be set in the common executable function. associated command (macro name) description eel_cmd_startup startup processing eel_cmd_write write processing eel_cmd_rea d read processing eel_cmd_refresh refresh processing eel_cmd_verify verify processing eel_cmd_format format processing eel_cmd_shutdown shutdown processing 5.1.2 user read access - status_enu eel stat us and error information. for info rmation about th e stat us and errors which might occur during the execution of the functions, see the description of the eel_execute function in section 5.4, eel functions. __near eel_u08* address_pu08 eel_u08 identifier_u08 eel_command_t command_enu ; eel_status_t status_enu ; bit0 b it15
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 33 of 5 3 mar . 28, 2014 5. 2 eel function calls this section describes how to call the eel functions from a user program written in c or assembly language. - c language when a n eel function is called from a user program in c language in the same way as a normal c function is c alled, the eel function?s parameters are passed to the eel as arguments and the required processing is performed. - assembly language before calling an eel function from a user program in assembly language, take necessary procedures (su ch as setting parameters or return addresses) based on the function - calling rules for the c compiler package used by the user as a development environment. the eel function?s parameters are passed to the eel as arguments and the required processing is performed. remarks 1 : to call the eel functions offered by the eel from a user program, you should define the following standard header file and include it in that program : c language fdl . h : fdl header file fdl_types.h : fdl definition setting header file eel.h : eel header file eel_types.h : eel definition setting header file assembly language fdl.inc : fdl head e r file eel.inc : eel header file eel_types.inc : ee l definition setting header file remarks 2 : if an eel function other than eel_init is called before eel_init is called, the correct operation is not g uaranteed. remarks 3 : if an eel function other than fdl_init is called before fdl_init is called, the correct operation is not guaranteed. 5. 3 data types below are the data types of the parameters to be specified for calling the eel functions offered by the eel . macro name description eel_u08 uns igned 8 - bit integers (unsigned char) eel_u16 unsigned 16 - bit integers (unsigned short) eel_u32 unsigned 32 - bit integers (unsigned long)
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 34 of 5 3 mar . 28, 2014 5. 4 eel function the subsequent sections describe the eel functions offered by the eel. th ese functions appear in the following forma t. name [function] describes the function overview of this function. [format] describes the format to call this function from a user program described in the c lan guage. describes the format to call this function from a use r program described in the assembly language . [ pre - conditions] describes the precondition of this function. [ post - conditions ] describes the post condition of this function. [cautions] describes the cautions of this function. [register status after calling this function] describes the register status after this function is called. [argument s ] describes the argument of this function. [r eturn values] describes the return values from this function.
rl78 family chapter 5 user interfac e eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 35 of 5 3 mar . 28, 2014 fdl_init [function] fdl initialization processing [format] fdl_status_t __far fdl_init(const __far fdl_descriptor_t* descriptor_pstr) call !fdl _ init or call !!fdl _ init remark call this function by using ! if placing the fdl at 00000h to 0ffffh or by using !! if not. [ pre - conditions] 1. the fsl and eel processing must be either not executing or finished. 2. the high - speed on- chip oscillator has been started up. [ post - conditions ] execute the fdl_open function. [cautions] 1. be sure to execute this function w hen starting eeprom emulation to make it possible to start accessing the data flash memory. 2. this function is mutually exclusive with the fsl. before executing this function, be sure to end fsl. also, never use any fsl functions during eeprom emulation . 3. to use fsl after this function is executed, the ram must be reinitialized, so always execute this function when restarting the eel. 4. to execute this function again, always be sure to end eel. 5. th e descriptor table used for this function cannot be modified. be sure to use a defined descriptor table. [register status after ca lling this function] return value : c corrupted registers : ax (argument), bc (argument) [argument s ] argument type description descriptor_pstr fdl_descriptor_t * (far) pointer to the descriptor table [return values] type symbol definition description fdl_status_t fdl_ok normal end fdl_err_configuration initialization error. the setting is incorrect. or high - speed on - chip oscillator does not run. make sure that the defined data has not been changed and the high - speed on - chip oscillator has b een started up. remark assembly language return values are stored in register c.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 36 of 5 3 mar . 28, 2014 fdl_open [function] fdl preparation processing set the data flash control register (dflctl) to the state where accessing the data flash memory is permitted (dflen = 1). [form at] v oid __far fdl_open(void) call !fdl _ open or call !!fdl _ open remark call this function by using ! if placing the fdl at 00000h to 0ffffh or by using !! if not. [ pre - conditions] the fdl_init function must have finisehed normally. [ post - conditions ] execute the eel_init function. [cautions] none [register status after calling this function] no registers are corrupted. [argument s ] none [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 37 of 5 3 mar . 28, 2014 fdl_close [function] fdl end processing set the data flash control register (dflctl) to the state where access to the data flash memory is inhibited (dflen = 0). all ongoin g eel processing stop. [format] void __far fdl_close(void) call !fdl _ close or call !!fdl _ close remark call this function by using ! if placing the fdl at 00000h to 0ffffh or by using !! if not. [ pre - conditions] the fdl_init, fdl_open, eel_init, eel_open, and eel_close functions must have finished normally . [ post - conditions ] none [cautions] no ne [register status a fter calling this function] no registers are corrupted . [argument s ] none [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 38 of 5 3 mar . 28, 2014 eel_init [function] processing to initialize the ram used for eeprom emulation [format] eel_status_t __far eel_init (void) call !eel _ init or cal l !!eel _ init remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] 1. the fsl and the eel processing must be either not executing or finished . 2. the fdl _init and fdl_open functi on must have finished normally. [ post - conditions ] execute the eel_ open function. [cautions] 1. when starting eeprom emulation, always execute this function to initialize the ram to b e used . 2. this function is mutually exclusive with fsl . before executing this function, be sure to close fsl . also, never use any fsl functions during eeprom emulation. 3. to use fsl after this function is executed, the ram mu st be reinitialized, so always execute this function when restarting eel . 4. to execute this function again, always close eel . [register status after calling this function] return values : c [argument s ] none [return values] type symbol definition description eel_status_t eel_ok normal end eel_err_configuration initialization error. the eel cannot be executed with the values set by the fdl_init and eel_init functions. check the current setting referring to section 4.3, initial values to b e s et by user. remark assembly language return values are stored in register c.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 39 of 5 3 mar . 28, 2014 eel_open [function] eeprom emulation preparation processing this function makes the eeprom emulation executable. [format] void __far eel_open(void) call !eel _ open or cal l !!eel _ open remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] 1. the fdl_init, fdl_open, and eel_init functions must have finished normally. 2. if eeprom emulation was executed, the processing up to eel_close and fdl_close function must be executed to stop the eeprom emulation processing . [ post - conditions ] none [cau tions] after the eel_open function is executed and the eeprom emulation has been transitioned to the opened state, the fsl cannot be executed. in addition, stop mode and halt mode cannot be executed. to execute the fsl, stop mode, or halt mode, execute the eel_close and fdl_close functions to transition the eeprom emulation to the uninitialized state . [register status after calling this function] no registers are corrupted. [argument s ] none [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 40 of 5 3 mar . 28, 2014 eel_close [function] eeprom emulation end processing this function makes the eeprom emulation unexecutable. [format] void __far eel_close(void) call !eel _ close or call !!eel _ close remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not . [ pre - conditions] if eeprom emula tion was executed, the eel_cmd_shutdown com mand must be used to set eeprom emulation to the stopped state (the opened state ). [ post - conditions ] execute the fdl_close function to exit the eeprom emulation. [cautions] none [regi ster status after calling this function] no registers are corrupted. [argument s ] none [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 41 of 5 3 mar . 28, 2014 eel_execute [function] eeprom emulation execution function each type of processing for performing eeprom emulation operations is specified for this function as an argument in the command format, and the processing is executed. [format] void __far eel_execute(__near eel_request_t* request_pstr) ; call !eel _ execute or call !!eel _ execute remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] the f dl _init, fdl_open and eel_init, eel_open functions must have finished normally. [ post - conditions ] 1. while status_enu of the request structure (eel_request_t) is e el_busy, execute the eel_handler function repeatedly. 2. the eel_execute function starts command processing and then immediately returns the control to the user program. the command processing is continued by executing the eel_han dler function. therefore, the eel_handler function must be executed continuously until the command processing is completed. [cautions] none [register status after calling this function] corrupted register : ax (argument) [argumen t s ] argument type description request_pstr eel_request_t* (near ) pointer to the request structure (eel_request_t) eel_request_t details member type description eel_request_t.address_pu08 eel_u08 * (near) pointer to the d ata buffer for storing write and read data note eel_request_t.identifier_u08 eel_u08 parameter for setting command to be executed eel_request_t.command_enu eel_command_t command to be executed eel_request_t.status_enu eel_status_t command execution sta tus note : specify this parameter only for a command that requires the parameter. set up the data buffer size according to the byte sizes of the write and read data.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 42 of 5 3 mar . 28, 2014 execution commands (eel_command_t) command description eel_cmd_startup this checks the block status and sets the system to the eeprom emulation start (started) stat e . if two active blocks exist, the incorrect block is changed to an in valid block. be sur e to execute this command before executing commands other than the eel_cmd_format command and make sure that the command finishes normally. eel_cmd_write note 1 this writes the specified data to the eel blocks. * the followi ng arguments must be specified prior to execution. ? address_pu08 : specifies the start address of the ram area where the write data is stored. ? identifier_u08 : specifies the data id of the write data. eel_cmd_read note 1 this reads the specified data from the eel blocks. * the following arguments must be specified prior to execution. ? address_pu08 : specifies the start address of the ram area where the read data is stored. ? identifier_u08 : specifies the data id of the read data. eel_cmd_verify note 1,2 this performs internal verification to check signal levels of the active block. this command verifies whether signal levels of flash memory cells are appropriate or not. eel_cmd_refresh note 1,3 this copies the latest stored data from the active eel block (copy source block) to the next block (copy destination block) in the eel pool after the erase processing. this makes the copy destination block active. eel_cmd_format this initializes (eras es) everything, including the data recorded in the eel blocks. be sure to use this command before using eeprom emulation for the first time. furthermore, use this command to initialize the entire blocks when an error (su ch as no active block) has occurred in eel blocks or when modifying values in the descriptor table (unchangeable fixed values). because eeprom emulation switches to the stopped stat e (opened) regardless of the results aft er the processing finishes, execute the eel_cmd_startup command to continue using eeprom emulation. eel_cmd_shutdown note 1 this sets eeprom emulation to the stopped stat e (opened). note 1 : do not execute this command until the eel_cmd_startup command has finished normally. note 2 : this command is not used to perform processing for reading written data and compare it. to compare written data , use the eel_execute (eel_cmd_read) functio n through the user program. note 3 : the erase processing is performed by executing the eel_cmd_refresh command.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 43 of 5 3 mar . 28, 2014 command execution statuse s of eel_execute / eel_handler (eel_status_t) (1/2) command execution status category description corresponding commands eel_ok meaning normal end all commands cause none action to be taken none eel_busy meaning a command is being executed. all commands cause none action to be taken keep calling eel_handl er function until the status changes. eel_err_pool_full meaning pool full error eel_cmd_write cause there is no area that can be used to write the data. action to be taken execute eel_cmd_refresh command and restart writi ng data. eel_err_initializatio n meaning initialization error all commands cause the fdl_init, fdl_open, eel_init, and eel_open functions have not been finished normally. action to be taken normally finish the f dl_init, fdl_open, eel_init, and eel_open functions. eel_err_access_locked meaning eeprom emulation lock error commands other than eel_cmd_startup and eel_cmd_format cause ee prom emulation cannot be executed. action to be taken make sure that the eel_cmd_startup command has finished normally. eel_cmd_undefined command error a command that does not exist has been specified. --- eel_err_v erify meaning when the eel_cmd_startup command was executed : an error occurred during the internal verification processing for the block header or the finally written data. when the eel_cmd_verify command was executed : an error occurred during the internal verification processing for the active block. eel_cmd_startup eel_cmd_verify cause some signal levels of flash memory cells were not appropriate. action to be taken execute the eel_cmd_refresh comm and. eel_err_parameter meaning parameter error all commands cause an incorrect command parameter has been specified. action to be taken revise the specified parameter. eel_err_rejected meaning reject error all commands cause a different command is being executed. action to be taken call the eel_handler function to terminate the ongoing command.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 44 of 5 3 mar . 28, 2014 command execution status es of eel_execute / eel_handler (eel_status_t) (2 /2) command execution sta tus category description corresponding commands eel_err_no_instance meaning no - write - data error eel_cmd_read cause the specified identifier data has not been written. action to be taken write data to the identifier specified using the eel_cmd_write command. eel_err_pool_inconsistent meaning eel block inconsistency error eel_cmd_startup cause an eel block has the undefined state (such as because there are no active blocks). action to be take n execute the eel_cmd_format command to initialize the eel blocks . eel_err_pool_exhausted meaning eel block exhaustion error eel_cmd_startup eel_cmd_format eel_cmd_refresh eel_cmd_write cause there are no more eel blocks that can be used to continue . action to be taken stop eeprom emulation . you can try restoration by executing the eel_cmd_format command (erasing all existing data) or read existing data. eel_err_internal meaning internal error commands other than eel_cmd_shutdown cause an unexpected error has occurred . action to be taken check the device state . [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 45 of 5 3 mar . 28, 2014 eel_handler [function] continuous eeprom emulation execution processing this function continues executing the eeprom emulation processing specified for t he eel_execute function. [format] void __far eel_handler(void) ; call !eel _handler or call !!eel _handler remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] 1. the f d l_init, fd l _open, and eel_init, eel_open functions must have finished normally. 2. the eel _execute function should execute note , and status_enu of the request structure (eel _request_t) should be eel _busy . note : execution of the eel _cmd_ shutdown command does not need execution of the ee l_handler function . however, we recommend that you follow the command operation flowchart shown in figure 3 -3. [ post - conditions ] while status_en u of the request structure (eel_request_t) is eel_busy, execute this function repeatedly. if the eel_handler function is executed while no command is executed, status_enu of of the request structure (eel_request_t) is not updated. [cautions] the command execution status of the eel_handler function is set for the ?eel_request_t* request? used as an argument of the eel_execute function. therefor e, when using the eel_hand ler function, do not free the ?eel_request_t* request? variable. for the execution state of the command specified by the eel_handler function, see the list of the eel_execute/eel_ handler command execution state (ee l_status_t) [register status after calling this function] no registers are corrupted. [argument s ] none [return values] none
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 46 of 5 3 mar . 28, 2014 eel_getspace [function] this obtains the free eel block space. [format] eel_status_t __far eel_getspace(__near eel_u16* space_pu16) call !eel_getspace or c all !!eel_getspace remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] th e f d l_init, fdl_open, eel_init, and eel_open functions, and the eel_execute function( eel_cm d_startup command ) must have finished normally. [ post - conditions ] none [cautions] 1. when the eel pool has been exhausted, 0 is always return ed to indicate that the re is no free space. 2. when an error value is return ed , the fre e space information remains unchanged. [register status after calling this function] return value : c corrupted register : ax (argument) [argument s ] argument type description space_pu16 eel_u16* (near) the address at which the free space information of the current active block is input [return values] type symbol definition description eel_status_t eel_ok normal end eel_err_initialization eel_init has not been executed. eel_err_access_lock ed the eel_cmd_startup command has not finished normally. eel_err_rejected a command is being executed. remark assembly language return values are stored in register c.
rl78 family chapter 5 user interface eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 47 of 5 3 mar . 28, 2014 eel_getversionstring [function] this obtains the version information of th e eel. [format] __far eel_u08* __far eel_getversionstring(void) call !eel_getversionstring or call !!eel_getversionstring remark call this function by using ! if placing the eel at 00000h to 0ffffh or by using !! if not. [ pre - conditions] none [ post - conditions ] none [cautions] none [register status after calling this function] none [argument s ] none [return values] type description eel_u08* (far) the address at which the version information of the eel is input (24- bit address area ) example : for eeprom emulation library pack0 2 v1.0 0 (ascii code) ?erl78t02r110_gvxxx? version information : v110v1.10 corresponding tool : r enesas electronics version type name : type02 corresponding device : rl78 target library : eel
rl78 family chapter 6 software resources and processing time eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 48 of 5 3 mar . 28, 2014 chapter 6 software resources and processing time 6. 1 pr ocessing time this section describes the eel processing time. figure 6 - 1 shows the concept of eel function response time and total processing time. the total processing time in the figure is the case of successful completio n and does not include the processing time in the case of abnormal end (such as incorrect input data or error). delay time due to execution of the eel_handler function is not included either. if the eel_handler function calling interval time is extended, the maximum total processing time may be exceeded. figure 6 -1 overview of processing time user program eel eel_execute status = busy eel_handler status = busy eel_handler status = busy eel_handler status = ok r esponse t ime total processing time
rl78 family chapter 6 software resources and processing time eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 49 of 5 3 mar . 28, 2014 table 6 -1 eel function response time of eeprom emulation library pack02 table 6 -2 total processing time of eeprom emulation library pack 02 re marks fc pu : cpu /peripheral hardwa re clock frequency (for example, at 20 mhz, f cpu = 20) block num : numbe r of eeprom emulation blocks func tions max time(full speed mode) max time(wide voltage mode) fdl_init 1199 / fcpu 1199 / fcpu fdl_open 27 / fcpu + 14us 27 / fcpu + 14us fdl _close 836 / fcpu + 444us 791 / fcpu + 969us eel_init 3268 / fcpu 3268 / fcpu eel_open 14 / fcpu 14 / fcpu eel_close 17 / fcpu 17 / fcpu eel_getspace 47 / fcpu 47 / fcpu eel_getversionstring 14 / fcpu 14 / fcpu eel_execute 320 / fcpu 320 / fcpu eel_handler 4582 / fcpu 4582 / fcpu func tions max time(full speed mode) max time(wide voltage mode) eel_execute / eel_handler eel_cmd_start up ( 280530 + 235 * block num ) / fcpu + 1612 us ( 277604 + 235 * block num ) / fcpu + 8798 us eel_cmd_format ( 67102 + 288981 * block num ) / fcpu + ( 266627 * block num ) us ( 67102 + 256218 * block num ) / fcpu + ( 303359 * block num ) us eel_cmd_refresh 1. f inished normally 5163828 / fcpu + 774424 us 5072479 / fcpu + 1421917 us eel_cmd_refresh 2 . refresh processing f ailed until block num - 1 ( 1554000 + 7538406 * (block num - 1) ) / fcpu + ( 15 48404 * (block num - 1) ) us ( 1554000 + 7355752 * (block num - 1) ) / fcpu + ( 2842866 * (block num - 1) ) us eel_cmd_verify 30869 / fcpu + 4126 us 19605 / fcpu + 29754 us eel_cmd_write 303387 / fcpu + 111858 us 289240 / fcpu + 253342 us eel_cmd_read 5102 / fcpu 5102 / fcpu eel_cmd_shutdown 219 / fcpu 219 / fcpu
rl78 family chapter 6 software resources and processing time eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 50 of 5 3 mar . 28, 2014 6. 2 software resources in the eel, program areas corresponding to parts of the library to be used, ram areas for variables to be used in the library, and ram areas for work area (self - ram) are used to assign an appropriate program to the user area. also, since the fdl will be used, the eel must have a separate area for use by the fdl. tables 6 - 3 and 6 - 4 list required software resources note 1, 2 . figures 6 - 2 and 6 - 3 show the images of allocating software resources to the ram. table 6 -3 software resources used by eel note 1 : please contact about products added after this document is issued. ite m size ( byte ) restrictions on allocation and usage note1,2 self - ram note3 0 to 1024 note 3 rl78/d1a ram 4kb rom 64kb fef00h to ff2ffh ram 16kb rom 256kb fbf00h to fc2ffh rl78/f12 ram 4kb rom 64kb fef00h to ff2f fh rl78/f13 ram 4kb rom 64kb ( r5f10ame (m = 6, a, b, g, l) ) fef00h to ff2ffh ram 8kb rom128kb fdf00h to fe2ffh rl78/f14 ram 8kb rom 96kb ( r5f10pmf ( m = g, l, m) ) fdf00h to fe2ffh ram 20kb rom 256kb faf00h to fb2ffh rl78/g1 3 ram 4kb rom 64kb fef00h to ff2ffh ram 20kb rom 256kb ( r5f100xj ( x = f, g, j, l, m, p ) ) faf00h to fb2ffh ram 32kb rom 512kb f7f00h to f82ffh rl78/g14 ram 5.5kb rom 48 kb fe900h to fecffh ram 5.5kb rom 64kb fe900h to fecffh ram 24kb rom 256kb f9f00h to fa2ffh rl78/g1a ram 4kb rom 64kb fef00h to ff2ffh rl78/i1a ram 4kb rom 64kb fef00h to ff2ffh rl78/l13 ram 8kb rom 128kb f df00h to fe2ffh rl78/l1c ram 16kb rom 192kb fbf00h to fc2ffh ram 16kb rom 256kb fbf00h to fc2ffh all note 1,2 products other than the abov e contact us. stack 80 can be allocated to a ram area other than the self - ram and the area from ffe20h to ffeffh data buffer note 4 1 to 255 request structure 5 saddr ram work area saddr : 3 (fdl : 2) (eel : 1) can be allocated to a short - addressing ram area library size 3400 (fdl : 600) (eel : 2800) can be allocated to any program area other than the self - ram and the area from ffe20h to ffeffh (rom is recommended) data table 3 to 68 fixed - p arameter area (default) 14 (fdl : 10) (eel : 2) eel blocks 3,072 or more (at least 3 blocks) only data flash memory can be used.
rl78 family chapter 6 software resources an d processing time eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 51 of 5 3 mar . 28, 2014 2 : the rl7 8/g12, l12 and g1c product does not support the eel 3 : an area used as the working area by the eel is called self - ram in th is manual and the release note. the self - ram requires no user setting because it is an area that is not mapped and automatically used at execution of the eel (previous data is discarded). when the eel is not used, the self - ram can be used as a normal ram space. for the rl78 microcontroller with self - ram , the chapter of "memory space" in the user's manual of the rl78 microcontroller has a note on an area (self - ram) whose usage is prohibited during self - programming. if the above table does not include the target rl78 mi crocontroller, refer to the user's manual of the target rl78 microcontroller. 4 : the data buffer is used as the working area for eel internal processing or the area where the data to be set is allocated in th e eel_execute function. the required size depends on the function to be used. table 6 -4 data buffer size used by eel functions n ote : an additional 5 - byte area is used by the request structure. figure 6 -2 arrangement example of self - ram and addresses ffe20h to ffeffh (rl78/g13 : product with 4 - kbyte ram and 64- kbyte rom) function name bytes function name bytes f d l_init 0 eel_ close 0 fdl_open 0 eel_execute note 0 to 255 fdl_close 0 eel_handler note 0 to 255 eel_init 0 eel_getspace 2 eel_open 0 eel_getversionstring 0
rl78 family chapter 6 software resources and processing time eeprom emulation l ibrary pack02 r01us00 68 ej0 100 rev. 1 .0 0 p age 52 of 5 3 mar . 28, 2014 figure 6 -3 arrangement example of addresses ffe20h to ffeffh (rl78/g13 : product with 2 - kbyte ram and 32- kbyte rom) 6. 2. 1 sections functions, constants, and variables to be used are allocated to specified sections in the eel and fdl. the following table lists sections defined by the eel and fdl. table 6 -5 sections used in the eel/fdl section name description fdl_code fdl?s code section that contains fdl programs. fdl_sdat fdl?s variable data section that contains variable data used in the fdl. place this section in the short addressing ram area. fdl_cnst fdl?s constant data section that contains constant data used in the fdl. eel_code eel?s code section that contains eel programs. eel_sdat eel?s variable data section that co ntains variable data used in the eel. place this section in the short addressing ram area. eel_cnst eel?s constant data section that contains constant data used in the eel.
rl78 family appendi x a revision history eeprom emulation l ibrary pack02 r01us0068 ej0 100 rev. 1 .0 0 p age 53 of 53 mar . 28, 201 4 appendix a revision history major changes in this document page change/addition type all newly created - remark : "type" in the above table indicates types of revisions. (a): correc tion of erroneous description (b) : addition/change to specifications (c) : addition/change to description or notes (d): addition/change to the package, order name, or classification (e): addition/change to related documents
? rl78 family user?s manual eeprom emulation library pack 02 publication date: mar 28 , 2014 rev. 1 .0 0 published by: renesas electronics corporation
http://www.renesas.com refer to "http://www.renesas.com/" for the latest and detailed information. renesas electronics america inc. 2801 scott boulevard santa clara, ca 95050-2549, u.s.a. tel: +1-408-588-6000, fax: +1-408-588-6130 renesas electronics canada limited 1101 nicholson road, newmarket, ontario l3y 9c3, canada tel: +1-905-898-5441, fax: +1-905-898-3220 renesas electronics europe limited dukes meadow, millboard road, bourne end, buckinghamshire, sl8 5fh, u.k tel: +44-1628-585-100, fax: +44-1628-585-900 renesas electronics europe gmbh arcadiastrasse 10, 40472 dsseldorf, germany tel: +49-211-6503-0, fax: +49-211-6503-1327 renesas electronics (china) co., ltd. room 1709, quantum plaza, no.27 zhichunlu haidian district, beijing 100191, p.r.china tel: +86-10-8235-1155, fax: +86-10-8235-7679 renesas electronics (shanghai) co., ltd. unit 301, tower a, central towers, 555 langao road, putuo district, shanghai, p. r. china 200333 tel: +86-21-2226-0888, fax: +86-21-2226-0999 renesas electronics hong kong limited unit 1601-1613, 16/f., tower 2, grand century place, 193 prince edward road west, mongkok, kowloon, hong kong tel: +852-2265-6688, fax: +852 2886-9022/9044 renesas electronics taiwan co., ltd. 13f, no. 363, fu shing north road, taipei 10543, taiwan tel: +886-2-8175-9600, fax: +886 2-8175-9670 renesas electronics singapore pte. ltd. 80 bendemeer road, unit #06-02 hyflux innovation centre, singapore 339949 tel: +65-6213-0200, fax: +65-6213-0300 renesas electronics malaysia sdn.bhd. unit 906, block b, menara amcorp, amcorp trade centre, no. 18, jln persiaran barat, 46050 petaling jaya, selangor darul ehsan, malaysia tel: +60-3-7955-9390, fax: +60-3-7955-9510 renesas electronics korea co., ltd. 12f., 234 teheran-ro, gangnam-ku, seoul, 135-920, korea tel: +82-2-558-3737, fax: +82-2-558-5141 sales offices ? 2014 renesas electronics corporation and renesas solutions corp. all rights reserved. colophon 3.0
Y? rl78 family R01US0068EJ0100


▲Up To Search▲   

 
Price & Availability of R01US0068EJ0100

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X